import { get, post } from '@/api/http-util.js'
import { returnMsg } from '@/api/return-util.js'

// user
export const login = async data => await returnMsg(post('/user/login', data))
export const register = async data => await returnMsg(post('/user/register', data))
export const updateUser = async data => await returnMsg(post('/user/updateUser', data))
export const getUserInfo = async data => await returnMsg(post('/user/getUserInfo', data))
export const forgetPass = async data => await returnMsg(post('/user/forgetPass', data))

// exam
export const getExamList = async data => await returnMsg(post('/exam/index', data))
export const getExamDetail = async data => await returnMsg(post('/exam/getDetail', data))
export const startExam = async data => await returnMsg(post('/exam/startExam', data))
export const updateTime = async data => await returnMsg(post('/exam/updateTime', data))
export const addAnswer = async data => await returnMsg(post('/exam/addAnswer', data))
export const endExam = async data => await returnMsg(post('/exam/endExam', data))
export const getExamScore = async data => await returnMsg(post('/exam/getExamScore', data))

// paper
export const getPaperList = async data => await returnMsg(post('/paper/index', data))
export const getPaperDetail = async data => await returnMsg(post('/paper/getDetail', data))
export const getQuestions = async data => await returnMsg(post('/paper/getQuestions', data))


// export const getHomeData02 = data => post('hello', data)
